<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #box {
        border: solid;
        width: 300px;
        height: 300px;
      }
    </style>
  </head>
  <body>
    <button id="closeBtn">X关闭</button>
    <script>
      const closeBtn = document.getElementById("closeBtn");
      closeBtn.onclick = function (e) {
        this.remove();
        // box.hidden = true;
      };
    </script>
  </body>
</html>
